/**
 * Created by cchen on 2015/5/11.
 */
//var iscroll = new iScroll("body", { "useTransition": true, "vScrollbar": false, "hScroll": false, "onScrollStart": function () {
//    //scrollControl = true;
//}})

/*  宝宝树66小区二次改造    add   gct  20170821   start   */
$(document).ready(function(){

            var params = {};
            if (window.location.pathname) {
                var parts = location.search.substring(1).split('&');
                for (var i = 0; i < parts.length; i++) {
                    var nv = parts[i].split('=');
                    if (!nv[0]) continue;
                    params[nv[0]] = nv[1] || true;
                }
            }
            $("#rep_messagebutton").on("click",function(){
               /* alert(params["id"]);*/
                var opt = {
                    mode : 2
                    ,type : 10
                    ,message : $("#reply").val()
                    ,uList:[params["id"]]
                };
                if ($("#reply").val().replace(/\s/g, "") == "") {
                    alert('回复内容不能为空！');return;
                } else{
                  /*  if(repTo != "main") {
                        if($("#select_person").val().replace(/\s/g, "") == ""){ alert('请点击每行进行选择！');return; }
                        reply.replies.replyTo = c.repId;
                    } else {
                        if(reply.replies.replyTo != undefined)delete reply.replies.replyTo;
                    }*/
                  /*  reply.replies.replyDesc = $("#reply").val();*/
                   /* alert("send message:"+$("#reply").val());*/
                    $.ajax({
                        url: 'http://' + backOfficeHost + '/rest/v1.0/mis/push/pushMessage',
                        type: "post",
                        dataType: "json",
                        data: opt,
                        timeout: 40000,
                        success: function (data) {
                            alert("SUCCESS");


                           /* var temp = {
                                replyDesc: reply.replies.replyDesc,
                                dateReplied: new Date(),
                                repliedBy: {
                                    nickName: '小6客服'
                                }
                            };
                            var html = "<li><div class = 'portrait-title'><span class = 'img-hv'><img src='http://t.res.66xiaoqu.com/group1/M00/00/03/rB75BFTZeeWAQScdAABIYpzs0fE223.png' onerror = 'imageError(this)'/><img src = '/pages/static/mobile/images/v.png'></span><div class = 'portrait-left'><span>"+ temp.repliedBy.nickName +"</span><br><span>"+ temp.dateReplied.getFullYear() +"-"+ (temp.dateReplied.getMonth()+1) +"-"+ temp.dateReplied.getDate() + " " + temp.dateReplied.getHours() +":"+ temp.dateReplied.getMinutes() +":"+ temp.dateReplied.getSeconds() +"</span></div></div><div class = 'clear'></div><div class = 'discuss-content ell'>"+ temp.replyDesc +"</div></li>";
                            $("#reply_list").append(html);

                            $("#reply").val('');//清空内容
                            reply.replies.replyDesc = "";*/
                        },
                        error: function (res,e) {
                            console.log(e);
                        }
                    });
                }
                $("#reply").val("");
               /* $('#doc-modal-Detail').modal("close");*/

            });


        });

/*  宝宝树66小区二次改造    add   gct  20170821   end   */